#ifndef TOKEN_H
#define TOKEN_H
#include <stdlib.h>
#include <string.h>

struct token {
        int category;   // the integer code returned by yylex
        char *text;     // the actual string (lexeme) matched
        int lineno;     // the line number on which the token occurs
        char *filename; // the source file in which the token occurs
        int ival;       // if you had an integer constant, store its value here
        char *sval;     // if you had a string constant, malloc space and store
};              //    the string (less quotes and after escapes) here


struct tokenlist {
        struct token t;
        struct tokenlist *next;
};


struct token *yytoken;
//extern struct tokenlist *TokenList;
//extern struct tokenlist* curr;
//extern int listsize;// = 0;
//extern int line_num;
extern char *fname;

extern char* yytext;

struct token *CreateToken(int code, char *text, int lineno, char *filename, int isstringorint);
void PrintList();

struct token *DupToken();
void DupToyytoken();
//void DupToyytoken(struct token* currtok) ;
#endif

